Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initialize this project #1

Merged
merged 22 commits into from
Dec 2, 2024
Merged

feat: initialize this project #1

merged 22 commits into from
Dec 2, 2024

Conversation

eddyxu
Copy link
Contributor

@eddyxu eddyxu commented Nov 30, 2024

  • Setting up CI
  • Get DX working
  • InMemoryCache

@eddyxu eddyxu requested a review from chebbyChefNEQ December 1, 2024 22:16
log = "~0.4"
moka = { version = "~0.12", features = ["future"] }
num_cpus = "1.16"
object_store = "~0.11"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have a range here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is 0.11,<0.12? Can we use more than that?

[dependencies]
async-trait = "0.1"
bytes = "~1.9"
futures = "0.3"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~

categories = ["caching"]

[dependencies]
async-trait = "0.1"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~

# ocra
OCRA: Object-store Cache in Rust for All
# OCRA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need an okra emoji lol

use crate::{paging::PageCache, Error, Result};

/// Default memory page size is 8 MB
pub const DEFAULT_PAGE_SIZE: usize = 8 * 1024 * 1024;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make this 16KiB? 8MIB is kinda huge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


/// Default memory page size is 8 MB
pub const DEFAULT_PAGE_SIZE: usize = 8 * 1024 * 1024;
const DEFAULT_TIME_TO_LIVE: Duration = Duration::from_secs(60 * 30); // 30 minutes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we default to no TTL?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default time to idle makes more sense since we are CoW.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this was time to idle. Forgot to rename it.

/// [PageCache] trait.
///
/// Caching fixed-size pages. Each page has a unique ID.
#[async_trait]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need dynamic dispatching here? can we do with just static dispatch with -> impl Future<...>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some rust help then.

Copy link

@chebbyChefNEQ chebbyChefNEQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for starting point

@eddyxu eddyxu merged commit 37cecc1 into main Dec 2, 2024
3 checks passed
@eddyxu eddyxu deleted the lei/init branch December 2, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants